<?php /*
	
*/ ?>
<?php include("inc/head.inc.php");
if(isset($_REQUEST['Submit']) && ($_REQUEST['Submit'])=="Send")
{
$mail_subject="Contact Us form from your E-Commerce Site";
$sql="select * from tblmystore";
	$res=$n02586916_db->select($sql);
	if($res)
	{
	$to=$res[0]['varowneremail'];
	//echo $to;
	}
$name=mysql_real_escape_string($_REQUEST['name']);
$email=mysql_real_escape_string($_REQUEST['email']);
$phone=mysql_real_escape_string($_REQUEST['phone']);
$mess=mysql_real_escape_string($_REQUEST['message']);
$message="Name       :".$name."\n\n"."Phone     :".$phone."\n\n"."Comments  :".$mess;
	$sqlemail = "select * from tblemails";
	$resemail = $n02586916_db->select($sqlemail);
	if($resemail)
	{
		$subject=stripslashes($resemail[0]['varcontactsub']);
		$message12=stripslashes($resemail[0]['txtcontactmess']);
	}
$headers = "From:E-Commerce Site";
$mail_subject=$subject;
$message=$message12;
	//mail($email, $mail_subject, $message, $headers);
	$sql="insert into tblcontact(`varname` ,`varemail`, `varphone`,`txtmess`)
				VALUES ('$name', '$email', '$phone','$mess')";
	$in=$n02586916_db->insert($sql);
	echo "<script>setTimeout(\"location.href='contactus.php?message=on'\", 1);</script>";	
}
?>
<table width="824" border="0" cellpadding="0" cellspacing="0"  align="center">
  
  <tr>
    <td class="headerclass"><?php include(INC."top.inc.php") ?></td>
  </tr>
  <tr>
    <td valign="top" class="maincontainer"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr><td valign="top"class="leftmenuback"><?php include(INC."left.inc.php") ?></td>
        <td valign="top">
		<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="24" class="head"><div class="pageheader">Contact Us</div></td>
        </tr>
		

        <tr>
          <td><table width="100%" border="0" align="left" cellpadding="0" cellspacing="2" class="prborderbg">
            <tr>
              <td height="23" colspan="4" class="search" bgcolor="#E9E9E9" style="border:1px solid #999999;">Mail Address </td>
            </tr>
			<?php 
				$sql="select * from tblmystore";
				$res=$n02586916_db->select($sql);
				if($res)
				{
			?>
			<tr>
			<td>&nbsp;</td>
              <td align="left" class="font"><?php echo stripslashes($res[0]['varstorename']);?>,<br /><?php echo stripslashes($res[0]['varstoreaddsandphone']);?>,<br /><?php echo stripslashes($res[0]['varzone']);?>,<br /><?php echo stripslashes($res[0]['varcountry']);?>,<br /><?php echo stripslashes($res[0]['varpostcode']);?></td>   
            </tr><?php }?>
          </table></td>
        </tr>
		<tr>
		<td>
		<?php
		if(isset($_REQUEST['message']) && ($_REQUEST['message'])=="on")	{
		$sql2="select * from tblemails";
		$res12=$n02586916_db->select($sql2);
			if($res12) {
				echo '<span class="msg">'.stripslashes($res12[0]['varcntmess']).'</span>';
			}
		}
		
		?></td>
		</tr>
        <tr>
          <td>
		  <form name="contact" method="post" action="">
		  <table width="100%"  border="0" align="left" cellspacing="2" class="prborderbg">
            <tr>
              <td height="23" colspan="4" class="search" bgcolor="#E9E9E9" style="border:1px solid #999999;">Send Your Query </td>
            </tr>
            <tr>
              <td width="3%" align="left" class="fontsmall">&nbsp;</td>
              <td width="18%" align="left" class="fntstyle">Name </td>
              <td width="3%" class="fontsmall">:</td>
              <td width="76%" align="left"><input name="name" type="text" class="feature_headingbg" id="name" value="" size="40" />              </td>
            </tr>
            <tr>
              <td align="left" class="fontsmall">&nbsp;</td>
              <td align="left" class="fntstyle"> E-Mail </td>
              <td class="fontsmall">:</td>
              <td align="left"><input name="email" type="text" class="feature_headingbg" id="email" value="" size="40" /></td>
            </tr>
            <tr>
              <td align="left" class="fontsmall">&nbsp;</td>
              <td align="left" class="fntstyle">Phone</td>
              <td class="fontsmall">:</td>
              <td align="left" class="blue_lorem"><input name="phone" type="text" class="feature_headingbg" id="phone" value="" size="40" /></td>
            </tr>
            <tr>
              <td align="left" valign="top" class="fontsmall">&nbsp;</td>
              <td align="left" valign="top" class="fntstyle">Message</td>
              <td valign="top" class="fontsmall">:</td>
              <td align="left" class="blue_lorem"><textarea name="message" cols="37" rows="9" class="proborder" id="message"></textarea></td>
            </tr>
            <tr>
              <td colspan="4" align="center"><input name="Submit" type="submit" class="feature_headingbg" value="Send"  onclick="return check();"/>              </td>
            </tr>
          </table>
		  </form>
		  </td>
        </tr> 
    </table>		</td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td><?php include "inc/bottom.inc.php"; ?></td>
  </tr>
</table>
</body>
</html>
